-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Refactor Django orcabus_id
#784
Conversation
operator.or_, (Q(**{"%s__iexact" % key: value}) | ||
# Apparently the `get_prep_value` from the custom fields.py is not called prior hitting the Db but, | ||
# the regular `__exact` still execute that function. | ||
operator.or_, (Q(**{"%s__exact" % key: value}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One caveat I found here is the strip/annotation will not work if it uses iexact
( on the custom filtering we had that based on model). Currently, changing it to filter for only exact match.
.. will review in tick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great effort!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great effort!
Implement custom Django custom-model-field for
orcabus_id
to include prefixes.Resolve #766
The Django custom works well and could pass with or without the prefix. A function is called to sanitize the
orcabus_id
before or after hitting the database.